﻿// -----------------------------------------------------------------------
// <copyright file="DeliveryDetailMapping.cs" company="DosTex">
// </copyright>
// -----------------------------------------------------------------------

namespace DosTexPrj.Implement.NHibernate.Mapping
{
    using System;
    using DosTexPrj.Core.Models;
    using FluentNHibernate.Mapping;

    /// <summary>
    /// TODO: Mapping DeliveryDetail class
    /// </summary>
    public class DeliveryDetailMapping : ClassMap<DeliveryDetail>
    {
        public DeliveryDetailMapping()
        {
            Table("DeliveryDetails");
            Id(x => x.Id, "DeliveryDetailID").UnsavedValue(Guid.Empty).GeneratedBy.Guid();
            References<Delivery>(x => x.BelongToDelivery).Column("DeliveryID").Not.LazyLoad();
            References<OrderDetail>(x => x.ReferenceToOrderDetail).Column("OrderDetailID").Not.LazyLoad();
            Map(x => x.KgQuantity).Not.Nullable();
            Map(x => x.MtQuantity).Not.Nullable();
        }
    }
}